{% include "head.html" %}

  <div id="stage" class="clearfix">
    <div class="content">      
      <div id="editbookmark" class="post"> <span class="absolute box_2_t_l"></span> <span class="absolute box_2_t_r"></span> <span class="absolute box_2_b_l"></span> <span class="absolute box_2_b_r"></span>
        {% ifequal mode "edit" %}
            <form id="editcategory" action="/admin/category/edit" method="post">
              <input type="hidden" name="id" id="id" value="{{category.id}}" />
            	
            	<label for="name">Name:</label> <br />
            	<input name="name" id="name" maxlength="100" value="{{category.name}}" /><br />
            	
            	<label for="description">Description:</label> <br />
            	<textarea name="description" id="description">{{category.description}}</textarea><br />
            	
            	<input type="submit" value="Submit" />
            </form>
            {% endifequal %}
            {% ifequal mode "add" %}
            <form id="addcategory" action="/admin/category/add" method="post">
            	
            	<label for="name">Name:</label> <br />
            	<input name="name" id="name" maxlength="100" /><br />
            	
            	<label for="description">Content:</label> <br />
            	<textarea name="description" id="description"></textarea><br />
            	
            	<input type="submit" value="Submit" />
            </form>
            {% endifequal %}
      </div>
      <!-- /post-nav -->
    </div>
    <div class="sidebar">

      <div class="mob"> <span class="absolute box_2_t_l"></span> <span class="absolute box_2_t_r"></span> <span class="absolute box_2_b_l"></span> <span class="absolute box_2_b_r"></span>
        <!-- begin popular posts -->
        <h2>Category List</h2>
        <a href="/admin/category/add">Add a Category</a><p>        
        {% for category in categorys %}<a href="/category/{{category.id}}">{{category.name}}</a> <a href="/admin/category/edit/{{category.id}}" >edit</a> | <a href="/admin/category/delete/{{category.id}}" >delete</a><br>{% endfor %}
        
      <!-- end popular posts -->  
      </div>

    </div>
  </div>
</div>
{% include "footer.html" %}
